﻿using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.SharePoint;

namespace CrossSiteCollectionSearchConfigurator
{
    internal class Utilities
    {
        private static bool CheckIsKeyValue(SPWeb web, string key)
        {
            bool isKey = (web.Properties.ContainsKey(key)
                                    && web.Properties[key] == Constants.TRUE_STRING);

            return isKey; 
        }

        public static bool CheckIsMaster(SPWeb web)
        {
            bool isMaster = CheckIsKeyValue(web, Constants.CS2C_IS_MASTER_KEY);

            return isMaster;
        }

        public static bool CheckIsSlave(SPWeb web)
        {
            bool isSlave = CheckIsKeyValue(web, Constants.CS2C_IS_SLAVE_KEY);

            return isSlave;
        }
    }
}
